package java12;

import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/4/17 11:25
 * 小球走过路程
 * https://www.nowcoder.com/practice/ddbb7021c0a7452f9044564234616913?tpId=220&tqId=2109873&ru=%2Fexam%2Foj&qru=%2Fta%2Fprimary-grammar-java%2Fquestion-ranking&sourceUrl=%2Fexam%2Foj
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        float h=scanner.nextFloat(); // 小球初始高度
        int n =scanner.nextInt(); // 小球反弹次数每次反弹原来的一半
        float distance = 0f; // 小球走过的总路程
        distance += h;
        while (n-- != 0) {
            h /= 2;
            if (n != 0) {
                distance += h * 2;
            }
        }
        System.out.println(String.format("%.3f", h) + " " + String.format("%.3f", distance));
    }
}
